package com.cll.prototype.redis;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/12/5 19:22
 */
@ContextConfiguration("classpath:spring-redis.xml")
public class RedisTemplateTest1 extends AbstractJUnit4SpringContextTests {

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    @Test
    public void testSetAndGet(){
        redisTemplate.opsForValue().set("name:author", "陈林林");
        System.out.println(redisTemplate.opsForValue().get("name:author"));
    }
}
